<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class AdminCheckInRecord extends Model
{
    //
    protected $autoWriteTimestamp = true;
    protected $updateTime = false;

    public function school() {
        return $this->belongsTo(AdminSchool::class, 'school_id')->bind([
            'school_name' => 'name'
        ]);
    }

    public function staff() {
        return $this->belongsTo(AdminStaff::class, 'staff_id')->bind([
            'staff_name' => 'name'
        ]);
    }

    public function getCreateTimeAttr($value) {
        return date('Y-m-d H:i:s', $value);
    }
}
